package com.example.myapplication;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {

    private TextView tvMianTitle;
    private ImageView ivMianlight;
    private Button btnMainLegitOn;
    private Button btnMainLegitOff;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
    }

    private void initView() {
        tvMianTitle = findViewById(R.id.tvMianTitle);
        ivMianlight = findViewById(R.id.ivMianlight);
        btnMainLegitOn = findViewById(R.id.btnMainLegit__on);
        btnMainLegitOff = findViewById(R.id.btnMainLegit__off);
        btnMainLegitOn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                        ivMianlight.setImageResource(R.drawable.__on);
            }
        });
        btnMainLegitOff.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ivMianlight.setImageResource(R.drawable.__off);
            }
        });
    }
}